<?php

namespace App\Lib;
class Game
{
    /*****************************
    参数
     *****************************/
    const Game_Type                 = 23;
    const Can_BreakRoom             = 1;   //是否能主动下庄
    const Guest_MaxCount            = 12;  //观战人数

    //房间最大人数和局数
    const Player_MaxCount   = [6, 9 , 12];    //人数
    const Game_NumberEach   = [6, 12, 24];    //局数

    //消耗房卡数([人数][局数])
    const Rule_TicketCount  = [
        6  =>[6=>2, 12 =>4, 24=>8 ],
        9  =>[6=>3, 12 =>6, 24=>12],
        12 =>[6=>4, 12 =>8, 24=>16],
    ];



    const PaymentType_Mode      = 2;    //房卡支付形式，1AA，2房主
    const PaymentType_AA        = 1;    //1AA
    const PaymentType_Creator   = 2;    //1房主

    //牌型倍率
//    const Rule_CardDefault_Multiple     = 1;    //默认，
//    const Rule_CardFour_Multiple        = 4;    //四花牛4倍
//    const Rule_CardFive_Multiple        = 5;    //五花牛5倍
//    const Rule_CardStraight_Multiple    = 6;    //顺子牛6倍
//    const Rule_CardFlush_Multiple       = 6;    //同花牛6倍
//    const Rule_CardCalabash_Multiple    = 6;    //葫芦牛6倍
//    const Rule_CardBomb_Multiple        = 8;    //炸弹牛8倍
//    const Rule_CardSequence_Multiple    = 9;    //同花顺9倍
//    const Rule_CardTiny_Multiple        = 10;   //五小牛10倍
    const Rule_Card_Multiple      = [
        1=>[//牛牛3倍，牛九3倍，牛八2倍
            "Default"   =>1,//默认
            "Card7"     =>1,
            "Card8"     =>2,
            "Card9"     =>2,
            "Card10"    =>3,
            "Four"      =>4,//四花牛4倍
            "Five"      =>5,//五花牛5倍
            "Straight"  =>6,//顺子牛6倍
            "Flush"     =>6,//同花牛6倍
            "Calabash"  =>6,//葫芦牛6倍
            "Bomb"      =>8,//炸弹牛8倍
            "Sequence"  =>9,//同花顺9倍
            "Tiny"      =>10,//五小牛10倍
        ],
        2=>[//牛牛4倍，牛九3倍，牛八牛七2倍
            "Default"   =>1,//默认
            "Card7"     =>2,
            "Card8"     =>2,
            "Card9"     =>3,
            "Card10"    =>4,
            "Four"      =>4,//四花牛4倍
            "Five"      =>5,//五花牛5倍
            "Straight"  =>6,//顺子牛6倍
            "Flush"     =>6,//同花牛6倍
            "Calabash"  =>6,//葫芦牛6倍
            "Bomb"      =>8,//炸弹牛8倍
            "Sequence"  =>9,//同花顺9倍
            "Tiny"      =>10,//五小牛10倍
        ]
    ];

    /*  用户状态    */
    const AccountStatus_Initial     = 0;    //首次进房初始状态
    const AccountStatus_Notready    = 1;    //未准备
    const AccountStatus_Ready       = 2;    //已准备
    const AccountStatus_Choose      = 3;    //选择抢庄
    const AccountStatus_Notgrab     = 4;    //不抢庄
    const AccountStatus_Grab        = 5;    //抢庄
    const AccountStatus_Betting     = 6;    //下注
    const AccountStatus_Notshow     = 7;    //未摊牌
    const AccountStatus_Show        = 8;    //摊牌

    /*  在线状态    */
    const OnlineStatus_Offline      = 0;    //离线
    const OnlineStatus_Online       = 1;    //在线

    /*  游戏状态   */
    const PlayingStatus_Waiting     = 1;    //等待别人中
    const PlayingStatus_Betting     = 2;    //下注中
    const PlayingStatus_Show        = 3;    //已摊牌

    /*  房间状态    */
    const RoomStatus_Waiting        = 1;    //等待中
    const RoomStatus_Playing        = 2;    //游戏中
    const RoomStatus_Closed         = 3;    //已关闭

    /*  操作超时时间  */
    const LimitTime_StartGame       = 20;   //第一局开局时限
    const LimitTime_Ready            = 8;    //每局之间时限
    const LimitTime_Show             = 8;    //摊牌时限
    const LimitTime_ClearRoom       = 300;  //清理房间时间

    /**
     * 房间类型
     */
    const BankerMode_FreeGrab           = 1;    //自由抢庄
    const BankerMode_SeenGrab           = 2;    //明牌抢庄
    const BankerMode_TenGrab            = 3;    //牛牛上庄
    const BankerMode_NoBanker           = 4;    //通比牛牛
    const BankerMode_FixedBanker        = 5;    //固定庄家
    /**
     * 抢庄模式，倒计时
     */
    const LimitTime_GrabBetting = [
        1=>["Grab"=>10, "Betting"=>10],     // 自由叫庄
        2=>["Grab"=>10, "Betting"=>10],     // 明牌抢庄
        3=>["Grab"=> 0, "Betting"=>10],     // 牛牛上庄
        4=>["Grab"=> 0, "Betting"=> 0],     // 通比牛牛
        5=>["Grab"=> 0, "Betting"=>10],     // 固定庄家
    ];

    /*  游戏回合    */
    const Circle_Grab               = 1;    //叫庄
    const Circle_Betting            = 2;    //下注
    const Circle_Show               = 3;    //摊牌

    const Default_Score             = 5;
    //底分类型
    const Rule_ScoreType = [
        1=>1,
        2=>2,
        3=>3,
        4=>4,
        5=>5
    ];

    const Rule_BettingType = [
        1 => 5,
        2 => 8,
        3 => 10
    ];




}

